#!/usr/bin/env node

const fs = require('fs'),
      path = require('path');
const src = process.argv[2];
      
if(process.argv.length === 2){
  //获得当前脚本文件名
  let scriptName = path.basename('17-my-stat.js');
  console.log(fs.statSync(scriptName));
}

try{
  console.log(fs.statSync(src));
}catch(e){
  console.error(e.message);
  process.exit(1);
}
